{include file="public/header" /}

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    共有数据：<strong id="count">{$list->total()}</strong> 条
                </div>
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>名称</th>
                                <th>等级</th>
                                <th>图标</th>
                                <th>购买价</th>
                                <th>总产币</th>
                                <th>日产币</th>
                                <th>算力值</th>
                                <th>周期</th>
                                <th>限购</th>
                                <th>赠送需直推人数</th>
                                <th>赠送需团队矿机数</th>
                                <th>赠送需团队总算力</th>
                                <th>状态</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            {foreach $list as $v}
                            <tr>
                                <td>{$v.id|default='0'}</td>
                                <td>{$v.name|default=''}</td>
                                <td>{$v.level|default=1}级</td>
                                <td><img onclick='showimg("{$v.cover}")' src="{$v.cover|default=''}" alt="图片"></td>
                                <td>{$v.price|default=0}</td>
                                <td>{$v.dividends|default=0}</td>
                                <td>{$v.day_dividends|default=0}</td>
                                <td>{$v.power|default=0}</td>
                                <td>{$v.day|default=0}</td>
                                <td>{$v.limits|default=0}</td>
                                <td>{$v.direct_push|default=0}</td>
                                <td>{$v.purchpeople|default=0}</td>
                                <td>{$v.teampeople|default=0}</td>
                                <td>{if $v.status == 1}上架{else}下架{/if}</td>
                                <td class="td-manage">
                                    <a title="编辑" onclick="data_edit('编辑','/hall/minging_edit?id={$v.id}')"
                                        href="javascript:;" class="layui-btn">
                                        编辑
                                    </a>
                                </td>
                            </tr>
                            {/foreach}

                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        {$list->render()|raw}
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use(['form', 'upload'], function () {
        var $ = layui.jquery
            , upload = layui.upload;
        //图片上传
        var uploadInst = upload.render({
            elem: '#test1'
            , url: 'users_top'
            , accept: 'file'
            , exts: 'xls|csv'
            , before: function (obj) {
                //预读本地文件示例，不支持ie8
                obj.preview(function (index, file, result) {
                    $('#demo1').attr('src', result); //图片链接（base64）
                });
            }
            , done: function (res) {
                //如果上传失败
                if (res.status > 0) {
                    return layer.msg(res.msg);
                }
                //上传成功
                return layer.msg(res.msg);
            }
            , error: function () {
                //演示失败状态，并实现重传
                var demoText = $('#demoText');
                demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
                demoText.find('.demo-reload').on('click', function () {
                    uploadInst.upload();
                });
            }
        });
    });

    function showimg(imgs) {
        layer.open({
            type: 1,
            title: false,
            shadeClose: true,
            skin: 'layui-layer-nobg', //没有背景色
            content: "<img src='" + imgs + "' style='width:100%;height: 100%;'>"
        });
    }
</script>
{include file="public/footer"}